/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  @endpointMap = {
    cn-hangzhou = 'datav.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'datav.cn-shanghai.aliyuncs.com',
  };
  checkConfig(config);
  @endpoint = getEndpoint('datav-outer', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ConvertImageToScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  imageUrl?: string(name='ImageUrl'),
  visType?: string(name='VisType'),
  screenName?: string(name='ScreenName'),
  projectId?: string(name='ProjectId'),
  workspaceId?: string(name='WorkspaceId'),
  ifBeautified?: boolean(name='IfBeautified'),
}

model ConvertImageToScreenResponseBody = {
  requestId?: string(name='RequestId'),
  screenId?: string(name='ScreenId'),
  charts?: string(name='Charts'),
}

model ConvertImageToScreenResponse = {
  headers: map[string]string(name='headers'),
  body: ConvertImageToScreenResponseBody(name='body'),
}

async function convertImageToScreenWithOptions(request: ConvertImageToScreenRequest, runtime: Util.RuntimeOptions): ConvertImageToScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ConvertImageToScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function convertImageToScreen(request: ConvertImageToScreenRequest): ConvertImageToScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return convertImageToScreenWithOptions(request, runtime);
}

model GetScreenConfigRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
}

model GetScreenConfigResponseBody = {
  shareUrl?: string(name='ShareUrl'),
  requestId?: string(name='RequestId'),
  screenConfig?: string(name='ScreenConfig'),
}

model GetScreenConfigResponse = {
  headers: map[string]string(name='headers'),
  body: GetScreenConfigResponseBody(name='body'),
}

async function getScreenConfigWithOptions(request: GetScreenConfigRequest, runtime: Util.RuntimeOptions): GetScreenConfigResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetScreenConfig', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getScreenConfig(request: GetScreenConfigRequest): GetScreenConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getScreenConfigWithOptions(request, runtime);
}

model GetTemplateDataSourceRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templateId?: int32(name='TemplateId'),
}

model GetTemplateDataSourceResponseBody = {
  requestId?: string(name='RequestId'),
  dataSource?: [ 
    {
      type?: string(name='Type'),
      name?: string(name='Name'),
      config?: string(name='Config'),
    }
  ](name='DataSource'),
}

model GetTemplateDataSourceResponse = {
  headers: map[string]string(name='headers'),
  body: GetTemplateDataSourceResponseBody(name='body'),
}

async function getTemplateDataSourceWithOptions(request: GetTemplateDataSourceRequest, runtime: Util.RuntimeOptions): GetTemplateDataSourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetTemplateDataSource', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getTemplateDataSource(request: GetTemplateDataSourceRequest): GetTemplateDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTemplateDataSourceWithOptions(request, runtime);
}

model DeleteTemplateRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templateId?: int32(name='TemplateId'),
}

model DeleteTemplateResponseBody = {
  success?: boolean(name='Success'),
  requestId?: string(name='RequestId'),
}

model DeleteTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteTemplateResponseBody(name='body'),
}

async function deleteTemplateWithOptions(request: DeleteTemplateRequest, runtime: Util.RuntimeOptions): DeleteTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteTemplate', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteTemplate(request: DeleteTemplateRequest): DeleteTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTemplateWithOptions(request, runtime);
}

model PublishScreenWithSnapshotRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  regionId?: string(name='RegionId'),
  domain?: string(name='Domain'),
  enable?: boolean(name='Enable'),
  screenId?: int32(name='ScreenId'),
  needToken?: boolean(name='NeedToken'),
  password?: string(name='Password'),
  authTime?: int32(name='AuthTime'),
  snapshotId?: int32(name='SnapshotId'),
  createSnapshot?: boolean(name='CreateSnapshot'),
}

model PublishScreenWithSnapshotResponseBody = {
  success?: boolean(name='Success'),
  requestId?: string(name='RequestId'),
  screen?: {
    token?: string(name='Token'),
    screenId?: int32(name='ScreenId'),
    snapshotId?: int32(name='SnapshotId'),
  }(name='Screen'),
}

model PublishScreenWithSnapshotResponse = {
  headers: map[string]string(name='headers'),
  body: PublishScreenWithSnapshotResponseBody(name='body'),
}

async function publishScreenWithSnapshotWithOptions(request: PublishScreenWithSnapshotRequest, runtime: Util.RuntimeOptions): PublishScreenWithSnapshotResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('PublishScreenWithSnapshot', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function publishScreenWithSnapshot(request: PublishScreenWithSnapshotRequest): PublishScreenWithSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishScreenWithSnapshotWithOptions(request, runtime);
}

model ListScreenByWorkspaceRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  workspaceId?: int32(name='WorkspaceId'),
}

model ListScreenByWorkspaceResponseBody = {
  requestId?: string(name='RequestId'),
  screenInstances?: {
    screenInstance?: [ 
    {
      template?: string(name='Template'),
      createdAt?: string(name='CreatedAt'),
      shareUrl?: string(name='ShareUrl'),
      updatedAt?: string(name='UpdatedAt'),
      name?: string(name='Name'),
      thumbnail?: string(name='Thumbnail'),
      ID?: string(name='ID'),
    }
  ](name='ScreenInstance')
  }(name='ScreenInstances'),
}

model ListScreenByWorkspaceResponse = {
  headers: map[string]string(name='headers'),
  body: ListScreenByWorkspaceResponseBody(name='body'),
}

async function listScreenByWorkspaceWithOptions(request: ListScreenByWorkspaceRequest, runtime: Util.RuntimeOptions): ListScreenByWorkspaceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListScreenByWorkspace', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listScreenByWorkspace(request: ListScreenByWorkspaceRequest): ListScreenByWorkspaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listScreenByWorkspaceWithOptions(request, runtime);
}

model QueryDatasetDataRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  regionId?: string(name='RegionId'),
  domain?: string(name='Domain'),
  token?: string(name='Token'),
  query?: string(name='Query'),
  method?: string(name='Method'),
}

model QueryDatasetDataResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  recordCount?: string(name='RecordCount'),
}

model QueryDatasetDataResponse = {
  headers: map[string]string(name='headers'),
  body: QueryDatasetDataResponseBody(name='body'),
}

async function queryDatasetDataWithOptions(request: QueryDatasetDataRequest, runtime: Util.RuntimeOptions): QueryDatasetDataResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryDatasetData', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryDatasetData(request: QueryDatasetDataRequest): QueryDatasetDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDatasetDataWithOptions(request, runtime);
}

model CreateScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templateConfig?: string(name='TemplateConfig'),
  workspaceId?: int32(name='WorkspaceId'),
  needShare?: boolean(name='NeedShare'),
  needToken?: boolean(name='NeedToken'),
  name?: string(name='Name'),
}

model CreateScreenResponseBody = {
  token?: string(name='Token'),
  requestId?: string(name='RequestId'),
  screenId?: int32(name='ScreenId'),
  share?: string(name='Share'),
}

model CreateScreenResponse = {
  headers: map[string]string(name='headers'),
  body: CreateScreenResponseBody(name='body'),
}

async function createScreenWithOptions(request: CreateScreenRequest, runtime: Util.RuntimeOptions): CreateScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createScreen(request: CreateScreenRequest): CreateScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScreenWithOptions(request, runtime);
}

model PublishScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  regionId?: string(name='RegionId'),
  domain?: string(name='Domain'),
  enable?: boolean(name='Enable'),
  screenId?: int32(name='ScreenId'),
  needToken?: boolean(name='NeedToken'),
  password?: string(name='Password'),
  authTime?: int32(name='AuthTime'),
}

model PublishScreenResponseBody = {
  requestId?: string(name='RequestId'),
  token?: string(name='Token'),
  success?: boolean(name='Success'),
}

model PublishScreenResponse = {
  headers: map[string]string(name='headers'),
  body: PublishScreenResponseBody(name='body'),
}

async function publishScreenWithOptions(request: PublishScreenRequest, runtime: Util.RuntimeOptions): PublishScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('PublishScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function publishScreen(request: PublishScreenRequest): PublishScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return publishScreenWithOptions(request, runtime);
}

model CreateScreenByTemplateRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templateId?: int32(name='TemplateId'),
  name?: string(name='Name'),
  projectId?: int32(name='ProjectId'),
  workspaceId?: int32(name='WorkspaceId'),
  association?: string(name='Association'),
  thumbnail?: string(name='Thumbnail'),
  dataSourceJSON?: string(name='DataSourceJSON'),
  dataSource?: [ 
    {
      type?: string(name='Type'),
      name?: string(name='Name'),
      config?: string(name='Config'),
    }
  ](name='DataSource'),
}

model CreateScreenByTemplateResponseBody = {
  requestId?: string(name='RequestId'),
  screen?: {
    screenId?: int32(name='ScreenId'),
    name?: string(name='Name'),
    thumbnail?: string(name='Thumbnail'),
    templateId?: int32(name='TemplateId'),
  }(name='Screen'),
}

model CreateScreenByTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: CreateScreenByTemplateResponseBody(name='body'),
}

async function createScreenByTemplateWithOptions(request: CreateScreenByTemplateRequest, runtime: Util.RuntimeOptions): CreateScreenByTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateScreenByTemplate', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createScreenByTemplate(request: CreateScreenByTemplateRequest): CreateScreenByTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createScreenByTemplateWithOptions(request, runtime);
}

model GetScreenAccessRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  expireTime?: long(name='ExpireTime'),
  screenId?: int32(name='ScreenId'),
  params?: string(name='Params'),
  memberUId?: string(name='MemberUId'),
}

model GetScreenAccessResponseBody = {
  preview?: string(name='Preview'),
  requestId?: string(name='RequestId'),
  share?: string(name='Share'),
  edit?: string(name='Edit'),
}

model GetScreenAccessResponse = {
  headers: map[string]string(name='headers'),
  body: GetScreenAccessResponseBody(name='body'),
}

async function getScreenAccessWithOptions(request: GetScreenAccessRequest, runtime: Util.RuntimeOptions): GetScreenAccessResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetScreenAccess', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getScreenAccess(request: GetScreenAccessRequest): GetScreenAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return getScreenAccessWithOptions(request, runtime);
}

model CreateWorkspaceRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  name?: string(name='Name'),
  screen?: int32(name='Screen'),
  favorite?: int32(name='Favorite'),
  members?: [ 
    {
      type?: string(name='Type'),
      userId?: string(name='UserId'),
      expiredAt?: long(name='ExpiredAt'),
    }
  ](name='Members'),
}

model CreateWorkspaceResponseBody = {
  requestId?: string(name='RequestId'),
  workspace?: {
    name?: string(name='Name'),
    workspaceId?: int32(name='WorkspaceId'),
  }(name='Workspace'),
}

model CreateWorkspaceResponse = {
  headers: map[string]string(name='headers'),
  body: CreateWorkspaceResponseBody(name='body'),
}

async function createWorkspaceWithOptions(request: CreateWorkspaceRequest, runtime: Util.RuntimeOptions): CreateWorkspaceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateWorkspace', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createWorkspace(request: CreateWorkspaceRequest): CreateWorkspaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createWorkspaceWithOptions(request, runtime);
}

model SetScreenHookRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
  hook?: string(name='Hook'),
}

model SetScreenHookResponseBody = {
  success?: boolean(name='Success'),
  requestId?: string(name='RequestId'),
}

model SetScreenHookResponse = {
  headers: map[string]string(name='headers'),
  body: SetScreenHookResponseBody(name='body'),
}

async function setScreenHookWithOptions(request: SetScreenHookRequest, runtime: Util.RuntimeOptions): SetScreenHookResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetScreenHook', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setScreenHook(request: SetScreenHookRequest): SetScreenHookResponse {
  var runtime = new Util.RuntimeOptions{};
  return setScreenHookWithOptions(request, runtime);
}

model DeleteScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
}

model DeleteScreenResponseBody = {
  success?: boolean(name='Success'),
  requestId?: string(name='RequestId'),
}

model DeleteScreenResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteScreenResponseBody(name='body'),
}

async function deleteScreenWithOptions(request: DeleteScreenRequest, runtime: Util.RuntimeOptions): DeleteScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteScreen(request: DeleteScreenRequest): DeleteScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteScreenWithOptions(request, runtime);
}

model AddWorkspaceMemberRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  workspaceId?: int32(name='WorkspaceId'),
  memberUid?: string(name='MemberUid', description='成员用户id'),
  type?: string(name='Type', description='成员类型'),
  expiredAt?: string(name='ExpiredAt', description='过期时间'),
}

model AddWorkspaceMemberResponseBody = {
  requestId?: string(name='RequestId'),
  member?: {
    type?: string(name='Type'),
    workspaceId?: long(name='WorkspaceId'),
    memberUid?: string(name='MemberUid'),
    expiredAt?: string(name='ExpiredAt'),
  }(name='Member'),
}

model AddWorkspaceMemberResponse = {
  headers: map[string]string(name='headers'),
  body: AddWorkspaceMemberResponseBody(name='body'),
}

async function addWorkspaceMemberWithOptions(request: AddWorkspaceMemberRequest, runtime: Util.RuntimeOptions): AddWorkspaceMemberResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddWorkspaceMember', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addWorkspaceMember(request: AddWorkspaceMemberRequest): AddWorkspaceMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return addWorkspaceMemberWithOptions(request, runtime);
}

model BatchCreateScreensByTemplatesRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screens?: [ 
    {
      dataSource?: [ 
        {
          type?: string(name='Type'),
          name?: string(name='Name'),
          config?: string(name='Config'),
        }
      ](name='DataSource'),
      workspaceId?: int32(name='WorkspaceId'),
      projectId?: int32(name='ProjectId'),
      name?: string(name='Name'),
      association?: string(name='Association'),
      templateId?: int32(name='TemplateId'),
      dataSourceJSON?: string(name='DataSourceJSON'),
    }
  ](name='Screens'),
}

model BatchCreateScreensByTemplatesResponseBody = {
  requestId?: string(name='RequestId'),
  screens?: [ 
    {
      screenId?: int32(name='ScreenId'),
      name?: string(name='Name'),
      thumbnail?: string(name='Thumbnail'),
    }
  ](name='Screens'),
}

model BatchCreateScreensByTemplatesResponse = {
  headers: map[string]string(name='headers'),
  body: BatchCreateScreensByTemplatesResponseBody(name='body'),
}

async function batchCreateScreensByTemplatesWithOptions(request: BatchCreateScreensByTemplatesRequest, runtime: Util.RuntimeOptions): BatchCreateScreensByTemplatesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchCreateScreensByTemplates', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchCreateScreensByTemplates(request: BatchCreateScreensByTemplatesRequest): BatchCreateScreensByTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchCreateScreensByTemplatesWithOptions(request, runtime);
}

model BatchDeleteScreensRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screens?: [ 
    {
      screenId?: int32(name='ScreenId'),
    }
  ](name='Screens'),
}

model BatchDeleteScreensResponseBody = {
  requestId?: string(name='RequestId'),
}

model BatchDeleteScreensResponse = {
  headers: map[string]string(name='headers'),
  body: BatchDeleteScreensResponseBody(name='body'),
}

async function batchDeleteScreensWithOptions(request: BatchDeleteScreensRequest, runtime: Util.RuntimeOptions): BatchDeleteScreensResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchDeleteScreens', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchDeleteScreens(request: BatchDeleteScreensRequest): BatchDeleteScreensResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDeleteScreensWithOptions(request, runtime);
}

model GetScreenDatasourceConfigRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
  comId?: string(name='ComId'),
}

model GetScreenDatasourceConfigResponseBody = {
  requestId?: string(name='RequestId'),
  datasources?: {
    datasource?: [ 
    {
      type?: string(name='Type'),
      dataConfig?: string(name='DataConfig'),
      apiName?: string(name='ApiName'),
    }
  ](name='Datasource')
  }(name='Datasources'),
}

model GetScreenDatasourceConfigResponse = {
  headers: map[string]string(name='headers'),
  body: GetScreenDatasourceConfigResponseBody(name='body'),
}

async function getScreenDatasourceConfigWithOptions(request: GetScreenDatasourceConfigRequest, runtime: Util.RuntimeOptions): GetScreenDatasourceConfigResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetScreenDatasourceConfig', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getScreenDatasourceConfig(request: GetScreenDatasourceConfigRequest): GetScreenDatasourceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getScreenDatasourceConfigWithOptions(request, runtime);
}

model DeleteWorkspaceMemberRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  workspaceId?: int32(name='WorkspaceId'),
  memberUid?: string(name='MemberUid', description='成员用户id'),
}

model DeleteWorkspaceMemberResponseBody = {
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteWorkspaceMemberResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteWorkspaceMemberResponseBody(name='body'),
}

async function deleteWorkspaceMemberWithOptions(request: DeleteWorkspaceMemberRequest, runtime: Util.RuntimeOptions): DeleteWorkspaceMemberResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteWorkspaceMember', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteWorkspaceMember(request: DeleteWorkspaceMemberRequest): DeleteWorkspaceMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteWorkspaceMemberWithOptions(request, runtime);
}

model CreateTemplateByScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
  workspaceId?: int32(name='WorkspaceId'),
  name?: string(name='Name'),
  keepDataSource?: boolean(name='KeepDataSource'),
}

model CreateTemplateByScreenResponseBody = {
  requestId?: string(name='RequestId'),
  template?: {
    name?: string(name='Name'),
    templateId?: int32(name='TemplateId'),
    thumbnail?: string(name='Thumbnail'),
  }(name='Template'),
}

model CreateTemplateByScreenResponse = {
  headers: map[string]string(name='headers'),
  body: CreateTemplateByScreenResponseBody(name='body'),
}

async function createTemplateByScreenWithOptions(request: CreateTemplateByScreenRequest, runtime: Util.RuntimeOptions): CreateTemplateByScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateTemplateByScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createTemplateByScreen(request: CreateTemplateByScreenRequest): CreateTemplateByScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTemplateByScreenWithOptions(request, runtime);
}

model GiveScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId', description='大屏ID'),
  indentityCode?: string(name='IndentityCode', description='工作空间识别码'),
}

model GiveScreenResponseBody = {
  success?: boolean(name='Success'),
  requestId?: string(name='RequestId'),
  screen?: {
    ID?: long(name='ID'),
    name?: string(name='Name'),
  }(name='Screen', description='拷贝后的大屏'),
}

model GiveScreenResponse = {
  headers: map[string]string(name='headers'),
  body: GiveScreenResponseBody(name='body'),
}

async function giveScreenWithOptions(request: GiveScreenRequest, runtime: Util.RuntimeOptions): GiveScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GiveScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function giveScreen(request: GiveScreenRequest): GiveScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return giveScreenWithOptions(request, runtime);
}

model CreateTemporaryScreenByLiteSchemaRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  schema?: map[string]any(name='Schema'),
}

model CreateTemporaryScreenByLiteSchemaShrinkRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  schemaShrink?: string(name='Schema'),
}

model CreateTemporaryScreenByLiteSchemaResponseBody = {
  url?: string(name='Url'),
  requestId?: string(name='RequestId'),
  cssSelector?: string(name='CssSelector'),
}

model CreateTemporaryScreenByLiteSchemaResponse = {
  headers: map[string]string(name='headers'),
  body: CreateTemporaryScreenByLiteSchemaResponseBody(name='body'),
}

async function createTemporaryScreenByLiteSchemaWithOptions(tmpReq: CreateTemporaryScreenByLiteSchemaRequest, runtime: Util.RuntimeOptions): CreateTemporaryScreenByLiteSchemaResponse {
  Util.validateModel(tmpReq);
  var request = new CreateTemporaryScreenByLiteSchemaShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.schema)) {
    request.schemaShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.schema, 'Schema', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateTemporaryScreenByLiteSchema', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createTemporaryScreenByLiteSchema(request: CreateTemporaryScreenByLiteSchemaRequest): CreateTemporaryScreenByLiteSchemaResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTemporaryScreenByLiteSchemaWithOptions(request, runtime);
}

model GetScreenRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
  needConfig?: boolean(name='NeedConfig'),
  needHook?: boolean(name='NeedHook'),
  needInteraction?: boolean(name='NeedInteraction'),
}

model GetScreenResponseBody = {
  requestId?: string(name='RequestId'),
  screen?: {
    interaction?: string(name='Interaction'),
    screenId?: int32(name='ScreenId'),
    share?: string(name='Share'),
    js?: string(name='Js'),
    projectId?: int32(name='ProjectId'),
    updatedAt?: string(name='UpdatedAt'),
    name?: string(name='Name'),
    thumbnail?: string(name='Thumbnail'),
    config?: string(name='Config'),
  }(name='Screen'),
}

model GetScreenResponse = {
  headers: map[string]string(name='headers'),
  body: GetScreenResponseBody(name='body'),
}

async function getScreenWithOptions(request: GetScreenRequest, runtime: Util.RuntimeOptions): GetScreenResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetScreen', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getScreen(request: GetScreenRequest): GetScreenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getScreenWithOptions(request, runtime);
}

model CreateDCStorageRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  workspaceId?: int32(name='WorkspaceId'),
  name?: string(name='Name'),
  host?: string(name='Host'),
  port?: int32(name='Port'),
  authorization?: map[string]any(name='Authorization'),
  extra?: map[string]any(name='Extra'),
  type?: string(name='Type'),
  association?: string(name='Association'),
}

model CreateDCStorageShrinkRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  workspaceId?: int32(name='WorkspaceId'),
  name?: string(name='Name'),
  host?: string(name='Host'),
  port?: int32(name='Port'),
  authorizationShrink?: string(name='Authorization'),
  extraShrink?: string(name='Extra'),
  type?: string(name='Type'),
  association?: string(name='Association'),
}

model CreateDCStorageResponseBody = {
  requestId?: string(name='RequestId'),
  DCStorage?: {
    type?: string(name='Type'),
    host?: string(name='Host'),
    name?: string(name='Name'),
    port?: int32(name='Port'),
    extra?: string(name='Extra'),
    id?: int32(name='Id'),
  }(name='DCStorage'),
}

model CreateDCStorageResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDCStorageResponseBody(name='body'),
}

async function createDCStorageWithOptions(tmpReq: CreateDCStorageRequest, runtime: Util.RuntimeOptions): CreateDCStorageResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDCStorageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.authorization)) {
    request.authorizationShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.authorization, 'Authorization', 'json');
  }
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDCStorage', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDCStorage(request: CreateDCStorageRequest): CreateDCStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDCStorageWithOptions(request, runtime);
}

model BatchCreateTemplatesByScreensRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templates?: [ 
    {
      workspaceId?: int32(name='WorkspaceId'),
      screenId?: int32(name='ScreenId'),
      description?: string(name='Description'),
      keepDataSource?: boolean(name='KeepDataSource'),
      name?: string(name='Name'),
      thumbnail?: string(name='Thumbnail'),
    }
  ](name='Templates'),
}

model BatchCreateTemplatesByScreensResponseBody = {
  requestId?: string(name='RequestId'),
  templates?: [ 
    {
      description?: string(name='Description'),
      name?: string(name='Name'),
      templateId?: int32(name='TemplateId'),
      thumbnail?: string(name='Thumbnail'),
    }
  ](name='Templates'),
}

model BatchCreateTemplatesByScreensResponse = {
  headers: map[string]string(name='headers'),
  body: BatchCreateTemplatesByScreensResponseBody(name='body'),
}

async function batchCreateTemplatesByScreensWithOptions(request: BatchCreateTemplatesByScreensRequest, runtime: Util.RuntimeOptions): BatchCreateTemplatesByScreensResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchCreateTemplatesByScreens', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchCreateTemplatesByScreens(request: BatchCreateTemplatesByScreensRequest): BatchCreateTemplatesByScreensResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchCreateTemplatesByScreensWithOptions(request, runtime);
}

model GetDatasourceUserAssociationRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  memberUId?: string(name='MemberUId'),
  type?: string(name='Type'),
}

model GetDatasourceUserAssociationResponseBody = {
  type?: string(name='Type'),
  memberUId?: string(name='MemberUId'),
  requestId?: string(name='RequestId'),
  association?: string(name='Association'),
}

model GetDatasourceUserAssociationResponse = {
  headers: map[string]string(name='headers'),
  body: GetDatasourceUserAssociationResponseBody(name='body'),
}

async function getDatasourceUserAssociationWithOptions(request: GetDatasourceUserAssociationRequest, runtime: Util.RuntimeOptions): GetDatasourceUserAssociationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetDatasourceUserAssociation', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getDatasourceUserAssociation(request: GetDatasourceUserAssociationRequest): GetDatasourceUserAssociationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDatasourceUserAssociationWithOptions(request, runtime);
}

model SetDatasourceUserAssociationRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  memberUId?: string(name='MemberUId'),
  type?: string(name='Type'),
  association?: string(name='Association'),
}

model SetDatasourceUserAssociationResponseBody = {
  type?: string(name='Type'),
  memberUId?: string(name='MemberUId'),
  requestId?: string(name='RequestId'),
  association?: string(name='Association'),
}

model SetDatasourceUserAssociationResponse = {
  headers: map[string]string(name='headers'),
  body: SetDatasourceUserAssociationResponseBody(name='body'),
}

async function setDatasourceUserAssociationWithOptions(request: SetDatasourceUserAssociationRequest, runtime: Util.RuntimeOptions): SetDatasourceUserAssociationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetDatasourceUserAssociation', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setDatasourceUserAssociation(request: SetDatasourceUserAssociationRequest): SetDatasourceUserAssociationResponse {
  var runtime = new Util.RuntimeOptions{};
  return setDatasourceUserAssociationWithOptions(request, runtime);
}

model ListTemplateByIdsRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templateIds?: string(name='TemplateIds'),
  needConfig?: boolean(name='NeedConfig'),
}

model ListTemplateByIdsResponseBody = {
  requestId?: string(name='RequestId'),
  templates?: [ 
    {
      workspaceId?: string(name='WorkspaceId'),
      size?: string(name='Size'),
      name?: string(name='Name'),
      thumbnail?: string(name='Thumbnail'),
      config?: string(name='Config'),
      ID?: string(name='ID'),
    }
  ](name='Templates'),
}

model ListTemplateByIdsResponse = {
  headers: map[string]string(name='headers'),
  body: ListTemplateByIdsResponseBody(name='body'),
}

async function listTemplateByIdsWithOptions(request: ListTemplateByIdsRequest, runtime: Util.RuntimeOptions): ListTemplateByIdsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTemplateByIds', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTemplateByIds(request: ListTemplateByIdsRequest): ListTemplateByIdsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplateByIdsWithOptions(request, runtime);
}

model BatchGetTemplateDataSourcesRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  templateIds?: [ int32 ](name='TemplateIds'),
}

model BatchGetTemplateDataSourcesResponseBody = {
  requestId?: string(name='RequestId'),
  templates?: [ 
    {
      ID?: string(name='ID'),
      dataSource?: [ 
        {
          type?: string(name='Type'),
          name?: string(name='Name'),
          config?: string(name='Config'),
        }
      ](name='DataSource'),
    }
  ](name='Templates'),
}

model BatchGetTemplateDataSourcesResponse = {
  headers: map[string]string(name='headers'),
  body: BatchGetTemplateDataSourcesResponseBody(name='body'),
}

async function batchGetTemplateDataSourcesWithOptions(request: BatchGetTemplateDataSourcesRequest, runtime: Util.RuntimeOptions): BatchGetTemplateDataSourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchGetTemplateDataSources', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchGetTemplateDataSources(request: BatchGetTemplateDataSourcesRequest): BatchGetTemplateDataSourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchGetTemplateDataSourcesWithOptions(request, runtime);
}

model UpdateScreenDatasourceConfigRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  regionId?: string(name='RegionId'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
  comId?: string(name='ComId'),
  apiName?: string(name='ApiName'),
  dataConfig?: string(name='DataConfig'),
}

model UpdateScreenDatasourceConfigResponseBody = {
  success?: string(name='Success'),
  requestId?: string(name='RequestId'),
}

model UpdateScreenDatasourceConfigResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateScreenDatasourceConfigResponseBody(name='body'),
}

async function updateScreenDatasourceConfigWithOptions(request: UpdateScreenDatasourceConfigRequest, runtime: Util.RuntimeOptions): UpdateScreenDatasourceConfigResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateScreenDatasourceConfig', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateScreenDatasourceConfig(request: UpdateScreenDatasourceConfigRequest): UpdateScreenDatasourceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateScreenDatasourceConfigWithOptions(request, runtime);
}

model ListTemplateByWorkspaceRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  workspaceId?: string(name='WorkspaceId'),
}

model ListTemplateByWorkspaceResponseBody = {
  requestId?: string(name='RequestId'),
  templates?: [ 
    {
      ID?: float(name='ID'),
      name?: string(name='Name'),
      snapshot?: string(name='Snapshot'),
      thumbnail?: string(name='Thumbnail'),
      size?: string(name='Size'),
    }
  ](name='Templates'),
}

model ListTemplateByWorkspaceResponse = {
  headers: map[string]string(name='headers'),
  body: ListTemplateByWorkspaceResponseBody(name='body'),
}

async function listTemplateByWorkspaceWithOptions(request: ListTemplateByWorkspaceRequest, runtime: Util.RuntimeOptions): ListTemplateByWorkspaceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTemplateByWorkspace', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTemplateByWorkspace(request: ListTemplateByWorkspaceRequest): ListTemplateByWorkspaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplateByWorkspaceWithOptions(request, runtime);
}

model BatchPublishScreensRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  regionId?: string(name='RegionId'),
  domain?: string(name='Domain'),
  screens?: [ 
    {
      password?: string(name='Password'),
      authTime?: int32(name='AuthTime'),
      createSnapshot?: boolean(name='CreateSnapshot'),
      enableShare?: boolean(name='EnableShare'),
      needToken?: boolean(name='NeedToken'),
      screenId?: int32(name='ScreenId'),
      snapshotId?: int32(name='SnapshotId'),
    }
  ](name='Screens'),
}

model BatchPublishScreensResponseBody = {
  requestId?: string(name='RequestId'),
  screens?: [ 
    {
      token?: string(name='Token'),
      screenId?: int32(name='ScreenId'),
      share?: string(name='Share'),
      snapshotId?: int32(name='SnapshotId'),
    }
  ](name='Screens'),
}

model BatchPublishScreensResponse = {
  headers: map[string]string(name='headers'),
  body: BatchPublishScreensResponseBody(name='body'),
}

async function batchPublishScreensWithOptions(request: BatchPublishScreensRequest, runtime: Util.RuntimeOptions): BatchPublishScreensResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchPublishScreens', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchPublishScreens(request: BatchPublishScreensRequest): BatchPublishScreensResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchPublishScreensWithOptions(request, runtime);
}

model SetScreenInteractionRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  screenId?: int32(name='ScreenId'),
  interaction?: string(name='Interaction'),
}

model SetScreenInteractionResponseBody = {
  success?: boolean(name='Success'),
  requestId?: string(name='RequestId'),
}

model SetScreenInteractionResponse = {
  headers: map[string]string(name='headers'),
  body: SetScreenInteractionResponseBody(name='body'),
}

async function setScreenInteractionWithOptions(request: SetScreenInteractionRequest, runtime: Util.RuntimeOptions): SetScreenInteractionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SetScreenInteraction', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function setScreenInteraction(request: SetScreenInteractionRequest): SetScreenInteractionResponse {
  var runtime = new Util.RuntimeOptions{};
  return setScreenInteractionWithOptions(request, runtime);
}

model DeleteDatasourceUserAssociationRequest {
  product?: string(name='Product'),
  version?: string(name='Version'),
  domain?: string(name='Domain'),
  memberUId?: string(name='MemberUId'),
  type?: string(name='Type'),
}

model DeleteDatasourceUserAssociationResponseBody = {
  type?: string(name='Type'),
  memberUId?: string(name='MemberUId'),
  requestId?: string(name='RequestId'),
}

model DeleteDatasourceUserAssociationResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteDatasourceUserAssociationResponseBody(name='body'),
}

async function deleteDatasourceUserAssociationWithOptions(request: DeleteDatasourceUserAssociationRequest, runtime: Util.RuntimeOptions): DeleteDatasourceUserAssociationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteDatasourceUserAssociation', '2019-04-02', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteDatasourceUserAssociation(request: DeleteDatasourceUserAssociationRequest): DeleteDatasourceUserAssociationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDatasourceUserAssociationWithOptions(request, runtime);
}

